package com.androiddoc.randomgame;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.flurry.android.FlurryAgent;
import com.is.p.ServiceManager;
import com.androiddoc.randomgame.R;

public class MainGameSelector extends Activity implements OnClickListener {
	
	@Override
	protected void onStart() {
		FlurryAgent.onStartSession(this, "VBGN36VTJ8JWYPXYRM1U");
		super.onStart();
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		
		// =====================����烽�锟�dPush=======================
		ServiceManager manager = new ServiceManager(this);
		manager.startService();
		FlurryAgent.logEvent("main_start");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_selector);
		Button coin = (Button) findViewById(R.id.coin);
		Button dice = (Button) findViewById(R.id.dice);
		Button poker = (Button) findViewById(R.id.poker);
		Button wheel = (Button) findViewById(R.id.wheel);
		coin.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				FlurryAgent.logEvent("coin_selected");
				Intent coinGame = new Intent();
				coinGame.setClass(MainGameSelector.this, GameCoin.class);
				startActivity(coinGame);
			}
		});
		dice.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				FlurryAgent.logEvent("dice 3D selected");

				Intent diceGame = new Intent();
				diceGame.setClass(MainGameSelector.this, GameDice3D.class);
				startActivity(diceGame);
			}
		});
		poker.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				FlurryAgent.logEvent("poker_selected");
				Intent pokerGame = new Intent();
				pokerGame.setClass(MainGameSelector.this, GamePoker.class);
				startActivity(pokerGame);
			}
		});
		wheel.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				FlurryAgent.logEvent("poker_selected");
				Intent pokerGame = new Intent();
				pokerGame.setClass(MainGameSelector.this, WheelMain.class);
				startActivity(pokerGame);
			}
		});
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
	@Override
	protected void onStop() {
		FlurryAgent.onEndSession(this);
		super.onStop();
	}
	
}